<template>
  <div class="News-card" @click="goInto(domain.text,domain.title)">
    <el-row :gutter="10">
      <el-col >
        <div class="title">
          {{domain.title}}
        </div>
      </el-col>
    </el-row>
    <el-row :gutter="10">
      <el-col :span="6" v-for="(m,index) in modulePictures" :key="index" style="padding-left:1rem">
        <el-image style="width: 100%; height: 180px" :src="m.modulePicturepath" fit="fill" alt>
          <div slot="error" class="image-slot">
            <i class="el-icon-picture-outline"></i>
          </div>
        </el-image>
      </el-col>
    </el-row>
    <el-row :gutter="10" type="flex">
      <el-col :span="6" style="text-align:left">
        <div class="card-header"></div>
        <div class="time">
          <i class="el-icon-time"></i>
          更新时间--<span>{{domain.modifiedTime}}</span>
        </div>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import { getAllPicture } from "@/api/module_picture";
export default {
  props: ["domain"],
  mounted: function () {
    //自动触发写入的函数
    this.getUrl();
  },
  data() {
    return {
      modulePictures: "",
      moduleId: this.domain.id,
    };
  },

  methods: {
    goInto(tex, title) {
      this.$router.push({
        name: "ReConD",
        path: "/detail",
        params: {
          content: tex,
          title: title,
        },
      });
    },
    getUrl() {
      getAllPicture(this.moduleId).then((res) => {
        this.modulePictures = res.data.modulePictures;
      });
    },
  },
};
</script>
<style>
.News-card {
  overflow: hidden;
  cursor: pointer;
  
  justify-content: flex-start;
  transition: 0.3s ease-in;
  padding: 10px;
  text-align: left;
}

.News-card .title {
  margin: 10px;
  white-space: nowrap;
  font-weight: 700;
}
.News-card .el-row {
  display: block;
}

.News-card .time {
  font-size: 0.8rem;
  color: #909399;
  margin: 10px;
}

.News-card .el-image {
  margin-top: 20px;
  width: 100px;
  height: 100px;

  box-shadow: 0 0 3px 1px rgba(51, 51, 51, 0.5);
  transition: 0.3s;
}
.News-card .el-image:hover {
  transform: translateY(-15px);
}
</style>